home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1599 / 1271 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  1.9 KB

  1. From: Ulrich Kuehn <kuehn@GOEDEL.UNI-MUENSTER.DE>
  2. Subject: Small patch for MiNT
  3. Date: Mon, 18 Apr 1994 10:30:38 +0200
  4.  
  5. Hello everybody!
  6.  
  7. When develloping software, I often noticed after program crashes that
  8. the output to the console or to the alert pipe was not sufficient to find
  9. the position of the crash. So I wrote this small patch that gives some
  10. more information about the program (addresses of the text, data and bss
  11. segment), so it is even possible to find the crash position in a shared
  12. text program...
  13.  
  14. ok, here it comes:
  15.  
  16. --- old\signal.c    Fri Apr  1 15:08:44 1994
  17. +++ signal.c    Fri Apr  1 15:15:22 1994
  18. @@ -214,11 +214,24 @@
  19.      else if (signames[sig]) {
  20.          if (!no_mem_prot && sig == SIGBUS) {
  21.              /* already reported by report_buserr */
  22.          } else {
  23. -            ALERT("%s: User PC=%lx (basepage=%lx)",
  24. +            /* uk: give some more information in case of a crash, so that a
  25. +             *     progam which shared text can be debugged better.
  26. +             */
  27. +            BASEPAGE *base;
  28. +            long ptext = 0, pdata = 0, pbss = 0;
  29. +
  30. +            base = curproc->base;
  31. +            if (base)   /* can it happen, that base == NULL???? */
  32. +            {
  33. +                ptext = base->p_tbase;
  34. +                pdata = base->p_dbase;
  35. +                pbss = base->p_bbase;
  36. +            }
  37. +            ALERT("%s: User PC=%lx (basepage=%lx, text=%lx, data=%lx, bss=%lx)",
  38.                  signames[sig],
  39. -                curproc->exception_pc, curproc->base);
  40. +                curproc->exception_pc, curproc->base, ptext, pdata, pbss);
  41.          }
  42.  /* save the processor state at crash time */
  43.  /* assumes that "crash time" is the context curproc->ctxt[SYSCALL] */
  44.  /* BUG: this is not true if the crash happened in the kernel; in the
  45.  
  46.  
  47. ok, I hope this will help someone,
  48.  
  49. Have fun,
  50. Ulrich
  51. --
  52. +---------------+----------------------------+-----------------------+
  53. | Ulrich Kuehn  | Internet:                  | Life is uncertain --  |
  54. | Cand.Math.Inf | kuehn@math.uni-muenster.de | eat the dessert first |
  55. +---------------+----------------------------+-----------------------+
  56.  
  57.  
  58.